﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DTOMall;
using DAOMall;
namespace MallProject.Default
{
    public partial class Contact : System.Web.UI.Page
    {
        FeedbackDTO fDTO = new FeedbackDTO();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string fullname = txtFullname.Text;
            string email = txtEmail.Text;
            string address = txtAddress.Text;
            string content = txtContent.Text;

            Feedback f = new Feedback();
            f.fullname = fullname;
            f.email = email;
            f.address = address;
            f.content = content;

            object obj = (object)f;
            bool check = fDTO.insert(obj);

            if (check)
            {
                Response.Write("<script>alert('Feedback success.');<script>");
            }
            else
            {
                Response.Write("<script>alert('Feedback error.');<script>");
                return;
            }

        }
    }
}